﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Uno_Pferderennen
{
    public partial class Form1 : Form
    {
        Random random = new Random();

        public Form1()
        {
            InitializeComponent();

            PB_Pferd1.Parent = pictureBox1;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void BT_Speichern_Click(object sender, EventArgs e)
        {
            PB_Pferd1.BackColor = Color.Transparent;
            Pferd1.Start();
            //panel1.Invalidate();
            pictureBox1.Invalidate();
        }

        private void Pferd1_Tick(object sender, EventArgs e)
        {
            Pferd1.Interval = random.Next(1, 10);

            if (PB_Pferd1.Left >= Convert.ToInt16(TB_Eingabe1.Text))
            {
                Pferd1.Stop();
            }
            else
            {
                PB_Pferd1.Left += (10);
            }
        }


    }
}
